/* Support program for testing gdb's ability to debug overlays
   in the inferior.  */

#include "ovlymgr.h"
#include "overlays.h"

int gdata1 __attribute__((section(".overlay4"))) = 0x1234;
int gdata2 __attribute__((section(".overlay5"))) = 0xabcd;

extern void overlay0 (void);
extern void overlay1 (void);
extern void overlay2 (void);
extern void overlay3 (void);

extern unsigned long _ovly_table_tmpl[][4];

void
overlay ()
{

  puts("/* Enter overlay Root portion */\n\r");
  OverlayLoad (0);
  OverlayLoad (4);
  overlay0 ();

  OverlayLoad (1);
  overlay1 ();

  OverlayLoad (2);
  OverlayLoad (5);
  overlay2 ();

  OverlayLoad (3);
  overlay3 ();
  return;
}

